package com.lagou.email.controller;

import com.lagou.email.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jacken
 * @date 2020/4/25 8:58 PM
 */
@RestController
@RequestMapping("/email")
public class EmailController {

  @Autowired
  private EmailService emailService;

  @RequestMapping("/{email}/{code}")
  public Boolean sendCode(@PathVariable("email") String email, @PathVariable("code") String code) {
    return emailService.sendEmail(email, code);
  }

}
